const db = require('../config/DBconnector');
const { DataTypes } = require('sequelize');
const { BlockAuditStatus } = require('../constants/DbEnum');

const name = 'BlockAudit';

const fields = {
  username: {
    type: DataTypes.STRING,
    allowNull: false,
  },
  orderId: {
    type: DataTypes.INTEGER,
    allowNull: false,
  },
  tradeId: {
    type: DataTypes.INTEGER,
    allowNull: false,
  },
  status: {
    type: DataTypes.STRING(12),
    allowNull: false,
    defaultValue: BlockAuditStatus.INIT,
  },
};

const model = db.define(name, fields);

module.exports = model;
